<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px">
            <p:tabView id="tabview" dynamic="true" cache="false" style="font-weight:normal;font-style:normal">
                <p:tab title="【仓库基本信息】新增表单">
                    <h:form>
                        <div id="qrytable">
                            <p:messages id="msgs" showDetail="false"/>
                            <p:panel style="margin-top:10px">
                                <h:panelGrid columns="4" cellspacing="5">
                                    <h:outputLabel   value="仓库编码:"/>
                                    <p:inputText required="true" value="#{warehouseAction.oaWarehouse.whCode}"/>
                                    <h:outputLabel   value="仓库名称:"/>
                                    <p:inputText required="true" value="#{warehouseAction.oaWarehouse.whName}"/>
                                    <h:outputLabel value="仓库位置:"/>
                                    <p:inputText required="true" value="#{warehouseAction.oaWarehouse.whAddr}"/>
                                    <h:outputLabel value="备注:"/>
                                    <p:inputText required="true" value="#{warehouseAction.oaWarehouse.remark}"/>
                                </h:panelGrid>
                                <p:separator  style="margin-top:10px"/>
                                <h:panelGrid columns="2" cellspacing="5">
                                    <p:commandButton style="width:90px;" value="提交"
                                                     action="#{warehouseAction.insertWarehouse}"
                                                     update="pdt,msgs">
                                    </p:commandButton>
                                    <p:commandButton ajax="true" id="resetBtn" type="reset" value="重置"
                                                     style="width:90px;" update="input,msgs">
                                    </p:commandButton>
                                </h:panelGrid>
                            </p:panel>
                            <p:ajaxStatus style="height:18px;text-align:center">
                                <f:facet name="start">
                                    <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                                </f:facet>
                                <f:facet name="complete">
                                    <h:outputText value=""/>
                                </f:facet>
                            </p:ajaxStatus>

                            <p:dataTable id="pdt" dynamic="true" style="width:100%;"
                                         value="#{warehouseAction.listWarehouse}" var="record"
                                         rowKey="#{record.pkid}"
                                         selection="#{warehouseAction.selectedOaWarehouseRecords}"
                                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                         paginator="true" rows="15" paginatorPosition="bottom"
                                         rowsPerPageTemplate="100,50,30,15,5"
                                         emptyMessage="...">

                                <p:column headerText="仓库编码">
                                    <h:outputText value="#{record.whCode}"/>
                                </p:column>

                                <p:column headerText="仓库名称">
                                    <h:outputText value="#{record.whName}"/>
                                </p:column>

                                <p:column headerText="仓库位置">
                                    <h:outputText value="#{record.whAddr}"/>
                                </p:column>

                                <p:column headerText="备注">
                                    <h:outputText value="#{record.remark}"/>
                                </p:column>

                            </p:dataTable>
                        </div>
                    </h:form>
                </p:tab>
            </p:tabView>
        </div>
    </ui:define>
</ui:composition>